FROM alpine:latest

LABEL maintainer="Zheng Qijun <zhengqijun0121@qq.com>"

ARG MIRROR=mirror.tuna.tsinghua.edu.cn

RUN sed -i "s/dl-cdn.alpinelinux.org/$MIRROR/g" /etc/apk/repositories && apk update && \
    apk add --no-cache -U bash bash-completion tzdata python3 py3-pip vim neovim build-base curl wget git tig \
        openssh-server openssh-client libc-dev ncurses tmux ranger neofetch ctags mkfontscale fontconfig perl \
        the_silver_searcher pcre htop mosh ripgrep tree nodejs npm zip unzip clang16-extra-tools && \
    rm -rf /var/cache/apk/* && \
    sed -i "s/#permitrootlogin.*/permitrootlogin yes/g" /etc/ssh/sshd_config && \
    echo 'root:111111' | chpasswd && \
    cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
    ssh-keygen -A && \
    git config --global user.name 'zhengqijun' && \
    git config --global user.email 'zhengqijun0121@qq.com' && \
    git clone -b coc https://gitee.com/zhengqijun/oh-my-dotfiles.git ~/.oh-my-dotfiles && \
    ~/.oh-my-dotfiles/install.sh --all

ENV TERM xterm-256color
ENV SHELL /bin/bash
ENV HOME /root
ENV USER root
ENV USERNAME root

WORKDIR $HOME

# ENTRYPOINT ["/bin/bash"]

EXPOSE 22

CMD ["/usr/sbin/sshd", "-D"]

# EOF

